a = [2,7,4,5]

for i in range(2*7*4*5):

    output = []
    output.append(i%5)
    i = i//5

    output.append(i%4)
    i = i//4

    output.append(i%7)
    i = i//7

    output.append(i%2)
    i = i//2
    print(output)
    